home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CHARTP10.ARJ / MAIN.CPP < prev    next >
C/C++ Source or Header  |  1992-01-26  |  1KB  |  41 lines

  1.  
  2. // Copyright 1992, David Perelman-Hall & Jamshid Afshar
  3.  
  4. #include <assert.h>
  5. #include <iostream.h>
  6. #include <strstream.h>
  7. #include <fstream.h>
  8. #include "category.h"
  9.  
  10. bool parse( const Category& goal, const Category_Sequence& string ); //###
  11.  
  12. extern unsigned int _stklen = 40000U;
  13.  
  14. const char *default_file = "parse.in";
  15.  
  16. int main(int argc, char *argv[])
  17. {
  18.    Category_Sequence input;
  19.    if (argc > 2) {
  20.       cerr << argv[0] << ": Parses an input sentence passed on the command line." << endl;
  21.       cerr << "parse \"sentence\"" << endl;
  22.       exit(1);
  23.    }
  24.    else if (argc==2) {
  25.       istrstream(argv[1]) >> input;
  26.       }
  27.    else { // argc==1
  28.       ifstream(default_file) >> input;
  29.       }
  30.  
  31.  
  32. /*
  33. //      Category("THEY") + Category("SEE");
  34.       Category("THEY") + Category("SEE") + Category("HER") + Category("REPORT");
  35. //      Category("THEY") + Category("REPORT") + Category("HER") + Category("SEE");
  36. */
  37.    if (!parse( Category("S"), input))
  38.       cout << "Unparsable.\n";
  39.    return 0;
  40. }
  41.